unit uSenhaIndividual;

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Vcl.Buttons;

type
  TfrmSenhaIndividual = class(TForm)
    Label1: TLabel;
    edtSenha: TEdit;
    btnOk: TBitBtn;
    btnCancelar: TBitBtn;
    procedure btnOkClick(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  frmSenhaIndividual: TfrmSenhaIndividual;

implementation

{$R *.dfm}

uses uConexao, uDadosGlobal;

procedure TfrmSenhaIndividual.btnOkClick(Sender: TObject);
begin
  ModalResult := mrNone;

  if edtSenha.Text <> dmDadosGlobal.sqlTblsensensenha.Value then
  begin
    MessageBox(Application.Handle, pchar('Senha incorreta.'), 'Alerta', MB_OK + MB_ICONWARNING);
    edtSenha.SelectAll;
    edtSenha.SetFocus;

    exit;
  end;

  ModalResult := mrOk;
end;

end.
